﻿using System;
using System.Web.Mvc;

using mvcForum.Web.Helpers;
using mvcForum.Core.Abstractions.Interfaces;
using mvcForum.Web.Results;

namespace mvcForum.Web.Areas.Forum.Controllers {

	/// <summary>
	/// Board controller,
	/// For now this controller only handles showing the version of the mvcForum.Core DLL.
	/// </summary>
	public class BoardController : Controller {
		private readonly IConfiguration config;

		public BoardController(IConfiguration config) {
			this.config = config;
		}

		/// <summary>
		/// This method is used by mvcforum.org to read the version of a mvcForum solution.
		/// </summary>
		/// <returns>Returns the version of the mvcForum.Core assembly as a JSON result.</returns>
		public ActionResult GimmeVersion() {
			return new JsonPResult(new { Version = ForumHelper.GetVersion() });
		}
	}
}